<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>设置</title>
		<link rel="stylesheet" href="dist/css/layui.css" />
		<link rel="stylesheet" href="css/iconfont.css" />
		<link rel="stylesheet" href="css/shouy.css" />
	</head>
	<style>
		.top_choice p {
			float: left;
			width: 50%;
			font-size: 16px;
			text-align: center;
			line-height: 35px;
		}
		
		.top_choice {
			border: 1px solid #2bb6f6;
			width: 200px;
			height: 35px;
			margin-left: 2%;
			border-radius: 5px;
		}
		
		.active {
			background: #2bb6f6;
		}
		
		.active a {
			color: #FFFFFF
		}
		
		.xzselect select {
			width: 120px;
			height: 35px;
			font-size: 15px;
			color: #928c8c;
			border: 1px solid #e6e6e6;
			background-color: #FFFFFF;
		}
		
		.sy_xftop {
			padding: 6px 0px;
		}
		
		.bx_btn {
			float: right;
			padding-right: 1rem;
			line-height: 35px;
		}
		
		.tk_bt {
			line-height: 35px;
		}
		
		.tk_bt textarea {
			margin-left: 27px;
			margin-top: 8px;
		}
		.sk_pay li{width:25%}
		.jjbbp_conbox {
			margin-top:20px;
			height: 73%;
			width:92.5%;
			margin-left: 20px;
		}
		.jjbbp_bt{color:#2bb6f6}
		.clearfix li{
			line-height: 35px;
		}
		.jjbbp_list li{font-size: 16px;}
		.update_pwd{padding-top:35px;float:left;width:50%}
		.update_pwd input{height: 35px;}
		.sy_jybtn{margin-left:25%}
	</style>

	<body>
		<div class="wrap">
			<div class="sy_header clearfix">
				<div class="sy_hleft">
					<ul class="sy_nav clearfix">
						<li>
							<a href="index.html">
								<div class="iconfont icon-shouyintai"></div>
								<p>工作台</p>
							</a>
						</li>
						<li>
							<a href="orders.html">
								<div class="iconfont icon-saomashouyin"></div>
								<p>订单流水</p>
							</a>
						</li>
						<li>
							<a href="yd.html">
								<div class="iconfont icon-shangpinshouyin"></div>
								<p>预定管理</p>
							</a>
						</li>
						<li>
							<a href="jiaoban.html">
								<div class="iconfont icon-shangpinshouyin"></div>
								<p>交班</p>
							</a>
						</li>
						<li class="active">
							<a href="xiaof_member.html">
								<div class="iconfont icon-weibiaoti-"></div>
								<p>设置</p>
							</a>
						</li>
					</ul>

				</div>
				<div class="sy_hright">
					<div class="sy_shopbox">
						<div class="sy_simg"><img id="toux" src="" style="background-color: #FFFFFF;"></div>
						<div class="sy_sinfo">
							<p class="sy_snam">店名：<span id="sname"></span></p>
							<p>用户：<span id="user"></span></p>
							<p class="exit" onclick="exit()">退出登陆</p>
						</div>
					</div>
				</div>

			</div>
			<div class=" clearfix">
				<div class="sy_xftop">
					<div class='top_choice'>
						<p class="tab_d1 active">
							<a href="set.html">密码修改</a>
						</p>
						<p class="tab_d1">
							<a href="#">关于我们</a>
						</p>
					</div>
				</div>
			</div>
			
			<div class="jjbbp_conbox">
				<div class='update_pwd'>
					<form class="layui-form" id="user_pwd" name="myForm">
					<div class="jjbbp_bt">登录密码修改</div>
					<ul class="jjbbp_list clearfix">
						<li>
							<span class="bt">原密码：<input type='password' name='y_pwd' id='y_pwd'></span>
						</li>
					</ul>
					
					<ul class="jjbbp_list clearfix">
						<li>
							<span class="bt">新密码：<input type='password' name='up_pwd' id='up_pwd'></span>
						</li>
					</ul>
					
					<ul class="jjbbp_list clearfix">
						<li>
							<span class="bt">确认密码：<input type='password' name='qe_pwd' id='qe_pwd'></span>
						</li>
					</ul>
					<div class="tk_bt">
						<input type="hidden" name='id' id='id'/>
						<button type="button" id="pwd_bun" class="sy_jybtn" >修改密码</button>
					</div>
					</form>
				</div>
				
				<div class='update_pwd'>
					<form class="layui-form" id="cz_pwd" name="myForm">
						<div class="jjbbp_bt">操作密码修改</div>
						<ul class="jjbbp_list clearfix">
							<li>
								<span class="bt">原密码：<input type='password' name='cz_y_pwd' id='cz_y_pwd'></span>
							</li>
						</ul>
						
						<ul class="jjbbp_list clearfix">
							<li>
								<span class="bt">新密码：<input type='password' name='cz_up_pwd' id='cz_up_pwd'></span>
							</li>
						</ul>
						
						<ul class="jjbbp_list clearfix">
							<li>
								<span class="bt">确认密码：<input type='password' name='cz_qe_pwd' id='cz_qe_pwd'></span>
							</li>
						</ul>
						<div class="tk_bt">
							<input type="hidden" name='cz_id' id='cz_id'/>
							<button type="button" id="cz_pwd_bun" class="sy_jybtn" >修改密码</button>
						</div>
					</form>
				</div>
			</div>
			
		</div>
				
</html>
<script type="text/javascript" src="dist/jquery-1.11.0.min.js"></script>
<script src="dist/json2.js"></script>
<script src="dist/layui.all.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
	$(function(){
		id = getValue("id");
		$('#id').val(id);
		$('#cz_id').val(id);
	});
	
	//修改登录密码
	$('#pwd_bun').click(function(){
		y_pwd = $('#y_pwd').val();
		up_pwd = $('#up_pwd').val();
		qe_pwd = $('#qe_pwd').val();
		if(y_pwd == "" ||  up_pwd == "" || qe_pwd == "" ) {
			layer.msg("请输入密码!");
			return false;
		}
		if(y_pwd ==up_pwd){
			layer.msg('不能使用原密码');
			return;
		}
		if(qe_pwd!==up_pwd){
			layer.msg('两次输入的密码不一致');
			return;
		}
		var con = layer.confirm('确认操作?', {icon: 3,title: '修改登录密码'},
			function(index) {
				$.ajax({
					type:'post',
					url: APP.api_url + "Index/up_pwd",
					data: $('#user_pwd').serialize(),
					success: function(data) {
						layer.msg(data.msg);
					}
				})
			});
		});
	
	//修改操作密码
	$('#cz_pwd_bun').click(function(){
		y_pwd = $('#cz_y_pwd').val();
		up_pwd = $('#cz_up_pwd').val();
		qe_pwd = $('#cz_qe_pwd').val();
		if(y_pwd == "" ||  up_pwd == "" || qe_pwd == "" ) {
			layer.msg("请输入密码!");
			return false;
		}
		if(y_pwd ==up_pwd){
			layer.msg('不能使用原操作密码');
			return;
		}
		if(qe_pwd!==up_pwd){
			layer.msg('两次输入的密码不一致');
			return;
		}
		var con = layer.confirm('确认操作?', {icon: 3,title: '修改操作密码'},
			function(index) {
				$.ajax({
					type:'post',
					url: APP.api_url + "Index/cz_pwd",
					data: $('#cz_pwd').serialize(),
					success: function(data) {
						layer.msg(data.msg);
					}
				})
			});
		});
	
</script>